{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin static %}
{% load ballot_icon %}
{% load ietf_filters %}
{% load django_bootstrap5 %}
{% block pagehead %}
    <link rel="alternate" type="application/atom+xml" href="/feed/iesg-agenda/">
    <link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Documents on future IESG telechat agendas{% endblock %}
{% block content %}
    {% origin %}
    <h1>Documents on future IESG telechat agendas</h1>
    {% include "iesg/nav.html" with active="agenda_documents" %}
    {% if user|has_role:"Secretariat" %}
        <form class="form-inline" method="post">
            {% csrf_token %}
        {% endif %}
        {% for t in telechats %}
            <h2>
                IESG telechat {{ t.date }}
                <br>
                <small class="text-body-secondary">
                    {{ t.pages }} page{{ t.pages|pluralize }}
                    {% if t.ad_pages_left_to_ballot_on %}
                        ({{ t.ad_pages_left_to_ballot_on }} pages left to ballot on)
                    {% endif %}
                </small>
            </h2>
            <div class="buttonlist">
                <a class="btn btn-primary" role="button" href="{% url 'ietf.iesg.views.agenda' %}">
                    <i class="bi bi-list"></i>
                    Full IESG agenda
                </a>
                <a class="btn btn-primary"
                   role="button"
                   href="{% url 'ietf.iesg.views.telechat_docs_tarfile' date=t.date %}">
                    <i class="bi bi-download"></i>
                    Download documents
                </a>
            </div>
            {% for num, section in t.sections %}
                {% if "docs" not in section or section.docs %}
                    {% if num|sectionlevel == 1 %}<h3 class="mt-3">{{ num }}. {{ section.title|safe }}</h3>{% endif %}
                    {% if num|sectionlevel == 2 %}<h4 class="mt-3">{{ num }} {{ section.title|safe }}</h4>{% endif %}
                    {% if num|sectionlevel == 3 %}<h5 class="mt-3">{{ num }} {{ section.title|safe }}</h5>{% endif %}
                {% endif %}
                {% if "docs" in section and section.docs %}
                    <table class="table table-sm {% if not user|has_role:'Area Director' %}table-striped{% endif %} tablesorter">
                        <thead>
                            <tr>
                                <th scope="col"></th>
                                <th scope="col" data-sort="document">Document</th>
                                <th scope="col" data-sort="date">Date</th>
                                <th scope="col" data-sort="status">Status</th>
                                <th scope="col" class="d-none d-sm-table-cell" data-sort="ipr">IPR</th>
                                <th scope="col" class="d-none d-sm-table-cell" data-sort="ad">AD/Shepherd</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for doc in section.docs %}
                                {% include "doc/search/search_result_row.html" with color_ad_position=True show_ad_and_shepherd=True %}
                            {% endfor %}
                        </tbody>
                    </table>
                {% endif %}
            {% endfor %}
            <hr>
        {% endfor %}
        {% if user|has_role:"Secretariat" %}
            {% bootstrap_button button_type="submit" content="Save reschedules" title="Save reschedule changes done with the drop-down boxes below" %}
        </form>
    {% endif %}
{% endblock %}
{% block js %}
    <script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}